import { TOKENNAME, APP_LANG, DEFAULT_LANG } from "@/config.js"
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex);

import { types, i18n } from './lang.js';

const gl = () => (uni.getStorageSync(APP_LANG) || DEFAULT_LANG)
const gt = (t) => ((i18n.messages[gl()][t] || '') || {})

let getters = {}
types.map(item => {
	getters[item] = () => gt(item)
});
export default getters